package org.bhf.service;

/**
 * Copyright (c) 2007, Blue Hole Software. All rights reserved.
 * Code licensed under the Apache 2.0 License:
 * http://www.apache.org/licenses/
 */

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletContext;

/**
 * All server side process (service method invocation, exception handling, ...) must return, implicitly
 * or explicitly, an implementation of <code>ProcessView</code>. For a <code>ProcessView</code> to be specified
 * in a <code>Service</code> or <code>ServiceMethod</code> annotation, it must have a three arg ctor: the first
 * arg is the service, the second arg is the method, and the third arg is the method result.
 */
public interface ProcessView
{
    /**
     * Process this view, including setting the response status and writing the response body, if
     * appropriate.
     *
     * @param request Servlet request
     * @param response Servlet response
     * @param servletContext The servlet context for this application
     * @throws Exception Problem during view processing
     */
    void    processView( final HttpServletRequest request, final HttpServletResponse response, final ServletContext servletContext )
        throws Exception;
}